home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / dwinst.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.2 KB  |  114 lines

  1. /* Copyright (C) 1999, Ghostgum Software Pty Ltd.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. // $Id: dwinst.h,v 1.2 2000/09/19 19:00:09 lpd Exp $
  20.  
  21. // Definitions for Ghostscript installer
  22.  
  23. #ifndef MAXSTR
  24. #ifdef MAX_PATH
  25. #define MAXSTR MAX_PATH
  26. #else
  27. #define MAXSTR 256
  28. #endif
  29. #endif
  30.  
  31. class CInstall  
  32. {
  33. public:
  34.     CInstall();
  35.     virtual ~CInstall();
  36.     void SetMessageFunction(void(*fn)(const char *));
  37.     void AddMessage(const char *message);
  38.     const char *GetMainDir();
  39.     const char *GetUninstallName();
  40.     BOOL GetPrograms(BOOL bUseCommon, char *buf, int buflen);
  41.     BOOL Init(const char *szSourceDir, const char *szFileList);
  42.     BOOL InstallFiles(BOOL bNoCopy, BOOL *pbQuit);
  43.     BOOL InstallFile(char *filename, BOOL bNoCopy);
  44.     BOOL MakeDir(const char *dirname);
  45.     FILE * MakeTemp(char *name);
  46.  
  47.     BOOL SetAllUsers(BOOL bUseCommon);
  48.     void SetTargetDir(const char *szTargetDir);
  49.     void SetTargetGroup(const char *szTargetGroup);
  50.  
  51.     BOOL StartMenuBegin();
  52.     BOOL StartMenuEnd();
  53.     BOOL StartMenuAdd(const char *szDescription, const char *szProgram, const char *szArguments);
  54.  
  55.     BOOL UpdateRegistryBegin();
  56.     BOOL UpdateRegistryKey(const char *product, const char *version);
  57.     BOOL UpdateRegistryValue(const char *product, const char *version, const char *name, const char *value);
  58.     BOOL UpdateRegistryEnd();
  59.  
  60.     BOOL WriteUninstall(const char *prog, BOOL bNoCopy);
  61.     BOOL MakeLog(void);
  62.  
  63.     void CleanUp(void);
  64.  
  65. private:
  66.     BOOL m_bNoCopy;
  67.     BOOL m_bUseCommon;
  68.     BOOL m_bQuit;
  69.  
  70.     // Source directory
  71.     char m_szSourceDir[MAXSTR];
  72.  
  73.     // File containing list of files to install
  74.     char m_szFileList[MAXSTR];
  75.  
  76.     // Target directory for program and fonts.
  77.     char m_szTargetDir[MAXSTR];
  78.  
  79.     // Target Group for shortcut
  80.     char m_szTargetGroup[MAXSTR];
  81.  
  82.     // Directory where the Start Menu is located.
  83.     char m_szPrograms[MAXSTR];
  84.  
  85.     // Name used for uninstall
  86.     char m_szUninstallName[MAXSTR];
  87.  
  88.     // Main directory prefix, where log files should be written
  89.     char m_szMainDir[MAXSTR];
  90.  
  91.     // Full directory where log files should be written
  92.     char m_szLogDir[MAXSTR];
  93.  
  94.     // Temporary log files for uninstall
  95.     char m_szFileNew[MAXSTR];
  96.     char m_szRegistryNew[MAXSTR];
  97.     char m_szRegistryOld[MAXSTR];
  98.     char m_szShellNew[MAXSTR];
  99.     char m_szShellOld[MAXSTR];
  100.  
  101.     // Log files
  102.     FILE * m_fLogNew;
  103.     FILE * m_fLogOld;
  104.  
  105.  
  106.     BOOL SetRegistryValue(HKEY hkey, const char *value_name, const char *value);
  107.     BOOL CreateShellLink(LPCSTR description, LPCSTR program, LPCSTR arguments, LPCSTR icon = NULL, int nIconIndex = 0);
  108.     void CopyFileContents(FILE *df, FILE *sf);
  109.  
  110.     void(*AddMessageFn)(const char *);
  111.  
  112. };
  113.  
  114.